using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.tif", false);
// Specifying rectangles for OMR.
const int markCount = 3;
Rectangle[] areas = new Rectangle[markCount];
// Each mark uses a quadruplet for its location (left, top, width, height).
areas[0] = new Rectangle(850, 1580, 30, 30); // First area left, top, width, height.
areas[1] = new Rectangle(850, 1620, 30, 30); // Second area left, top, width, height.
areas[2] = new Rectangle(850, 1660, 30, 30); // Third area left, top, width, height.
int[] confidences = new int[markCount];
int[] filled = gdpictureImaging.OMRDetectOvalMarks(imageID, areas, markCount, 0.5, confidences, false);
StringBuilder result = new StringBuilder();
for (int index = 0; index < markCount; index++)
{
result.AppendLine("Index:" + index.ToString());
result.AppendLine("Left:" + areas[index].X.ToString());
result.AppendLine("Top:" + areas[index].Y.ToString());
result.AppendLine("Width:" + areas[index].Width.ToString());
result.AppendLine("Height:" + areas[index].Height.ToString());
result.AppendLine("Confidence:" + confidences[index].ToString());
result.AppendLine("Filled:" + filled[index].ToString());
result.AppendLine();
}
MessageBox.Show(result.ToString(), "Result", MessageBoxButtons.OK, MessageBoxIcon.Information);
gdpictureImaging.ReleaseGdPictureImage(imageID);
}